import java.util.Scanner;

public class protice28 {
    public static void main(String[] args) {
        /**
         * 参加青年歌手大奖赛,有8个评委打分,(去掉一个最高一个最低)求平均分?
         */
        double[]arr=new double[8];
        double sum = 0;

        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请第"+(i+1)+"位评委打分");
            arr[i] = sc.nextDouble();
        }
        method.bubbleSort(arr);
        for (int i = 1; i < arr.length-1; i++) {
            sum += arr[i];
        }
        System.out.println(sum);
        double avg = sum/(arr.length-2);
        System.out.println(avg);
    }
}
